package com.accp.hotevent.service;

import com.accp.hotevent.dao.NoticeDao;
import com.accp.hotevent.entity.Notice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class NoticeService {

    @Autowired
    NoticeDao noticeDao;

    public void add(Notice notice){
        notice.setReadStatus("Unread");
        notice.setCreateTime(new Date());
        noticeDao.add(notice);
    }

    public void updateStatus(Notice notice){
        noticeDao.updateStatus(notice);
    }

    public List<Notice> getList(Notice notice){
        return noticeDao.getList(notice);
    }
}
